package com.zero.domain;

import com.zero.common.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
    * 订单表
    */
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder    // 与@Builder的区别：子类可以使用链式方法 给父类属性赋值
public class Order extends BaseEntity {
    /**
    * 订单ID 主键
    */
    private Integer orderId;

    /**
    * 会员ID
    */
    private Integer userId;

    /**
    * 单车ID
    */
    private Integer bicycleId;

    /**
    * 订单编号
    */
    private String orderSn;

    /**
    * 单车编号
    */
    private String bicycleSn;

    /**
    * 会员名字(账号)
    */
    private String userName;

    /**
    * 会员头像地址
    */
    private String userAvatar;

    /**
    * 会员总积分
    */
    private String userScore;

    /**
    * 付款方式(0:现金  1:支付宝  2:微信  3:银行卡)
    */
    private Integer payType;

    /**
    * 订单开始时间
    */
    private Date beginTime;

    /**
    * 订单结束时间
    */
    private Date endTime;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("orderId", getOrderId())
                .append("userId", getUserId())
                .append("bicycleId", getBicycleId())
                .append("orderSn", getOrderSn())
                .append("bicycleSn", getBicycleSn())
                .append("userName", getUserName())
                .append("userAvatar", getUserAvatar())
                .append("userScore", getUserScore())
                .append("payType", getPayType())
                .append("beginTime", getBeginTime())
                .append("endTime ", getEndTime())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }




    /*@Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", orderId=").append(orderId);
        sb.append(", userId=").append(userId);
        sb.append(", bicycleId=").append(bicycleId);
        sb.append(", orderSn=").append(orderSn);
        sb.append(", bicycleSn=").append(bicycleSn);
        sb.append(", userName=").append(userName);
        sb.append(", userAvatar=").append(userAvatar);
        sb.append(", userScore=").append(userScore);
        sb.append(", payType=").append(payType);
        sb.append(", beginTime=").append(beginTime);
        sb.append(", endTime=").append(endTime);
        sb.append(", createBy=").append(createBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", remark=").append(remark);
        sb.append("]");
        return sb.toString();
    }*/
}
